<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            width: 200px;
            height: 200px;
            position: absolute;
            top:50%;
            left:50%;
            background-color:blueviolet;
            transform:translate(-50%,-50%);
        }

    </style>
</head>
<body>
    <div class="box1"></div>
</body>
</html>